package www.lagou.app;

import www.lagou.dao.PhoneDao;
import www.lagou.entity.Phone;

import java.sql.SQLException;
import java.util.List;

public class Test2 {

    public static void main(String[] args) {
        PhoneDao phoneDao = new PhoneDao();
        List<Phone> list = null;

        try {
            list = phoneDao.findPhoneByPrice(2000,"2019");
            System.out.println("需求1结果：");
            for (Phone phone:list){
                System.out.println(phone.toString());
            }

            System.out.println("需求2结果:");
            list = phoneDao.findPhoneByColor("白色");
            for (Phone phone:list){
                System.out.println(phone.toString());
            }
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
}
